//第四章
//1、一个学生类和子类Undergraduate
class Student {
    public String name;
    public int age;
    public Student(String name,int age){
        this.name=name;
        this.age=age;
    }
    public void show(){
        System.out.println("name: "+name+" age: "+age);
    }
}
/*
public class Main {
    public static void main(String[] args) {
        Student student=new Student("张三",18);
        student.show();
        Undergraduate undergraduate=new Undergraduate("李四",28,"学士");
        undergraduate.show();

        Shape square=new Square();
        Shape circle= (Shape) new Circle();
        System.out.println(square.area(2));
        System.out.println(circle.area (3));


    }
}
//Undergraduate类
public class Undergraduate extends Student {
   private String degree=" ";
   public Undergraduate(String name,int age,String degree){
     super(name,age);
       this.degree=degree;
   }
   public void show(){
       System.out.println("Undergraduate{"+"degree='"+degree+'\''+'}');
    }
}
 */